/**
 * Created by ying on 16-11-7.
 */
var d=false;//是否有小数点
var s;//是否运算过
function get_content(num){//点击数字键
    var str=document.getElementById("operation_box");
    if(s==true){
        str.value='';
        s=false
    }
    str.value+=num;
}
function get_calculator(fuhao){//点击符号键
    d=false;
    var str=document.getElementById("operation_box");
    str.value+=fuhao;
}

function get_clear(){   //按钮C，清除
    document.getElementById("operation_box").value='';
}

function get_back_space(){  //返回键
    var text=document.getElementById("operation_box");
    text.value=text.value.slice(0,text.value.length-1)
}

function get_dots(dot){//小数点
    var str=document.getElementById("operation_box");
    if(d==true){
        return false;
    }else{
        str.value+=dot;
        d=true;
    }
}

function get_percent_sign(){//百分号%
    var str=document.getElementById("operation_box");
    str.value=str.value/100;
}

function get_result(){//输出结果
    var str=document.getElementById("operation_box");
    str.value=eval(str.value).toFixed(15)*1000000000000000/1000000000000000;
    s=true;
}



